package com.loong.controller;

import com.loong.entity.Category;
import com.loong.service.impl.CategoryServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author loong
 * @since 2024-12-08
 */
@RestController
@RequestMapping("/category")
public class CategoryController {

    @Autowired
    public CategoryServiceImpl categoryService;
    @GetMapping("/categories")
    public List<Category> categories(){
        List<Category> list = categoryService.list();
        return list;
    }
}
